package MyXML;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

public class demo1 {
    public static void main(String[] args) throws DocumentException {
        //读取xml文件中的数据
        //将xml转换成文档
        SAXReader saxReader = new SAXReader();
        Document document = saxReader.read("D:\\software\\code\\2023_java\\2023_java_code\\code_24_4_29\\src\\MyXML\\text2.xml");
        //先获取到根标签
        Element rootElement = document.getRootElement();
        System.out.println(rootElement.getName());


    }
}
